package com.coder.search.pojo;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;

import java.io.Serializable;

/**
 * @BelongsProject:coder_parent
 * @BelongsPackage:com.coder.search.pojo
 * @Author:linchong
 * @CreateTime:2019-01-05 20:04
 * @Description:
 */
@Document(indexName = "coder_article",type="article")
public class Article  implements Serializable {
    @Id
    private String id; //ID

    //是否索引：该域是否能被搜索
    //是否分词：搜索时是整体匹配还是单词匹配
    //是否存储：是否在页面上显示
    @Field(index = true,analyzer = "ik_max_word",
    searchAnalyzer = "ik_max_word")
    private String title;  //标题

    @Field(index = true,analyzer = "ik_max_word",
    searchAnalyzer = "ik_max_word")
    private String content;  //正文

    private String state;//审核状态

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }
}
